#include <stdio.h>
int sum_array(const int a[], int n) {
    const int *p; 
    int sum;
    sum = 0;
    for (p = a; p < a + n; p++)
        sum += *p;
    return sum;
}
int main(void)
{
    int n = 5;
    int a[5] = {1, 2, 3, 4, 5};
    printf("%d\n", sum_array(a, n));
    return 0;
}